﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JTZY.Model.Opdata.Dto
{
    public class SaleOpdata
    {
        [ExcelColumn(Name = "所属地区")]
        [ExcelColumnName("所属地区")]
        public string AreaNames { get; set; }

        [ExcelColumn(Name = "客户账号")]
        [ExcelColumnName("客户账号")]
        public string AccountCode { get; set; }

        [ExcelColumn(Name = "客户名称")]
        [ExcelColumnName("客户名称")]
        public string UserName { get; set; }

        [ExcelColumn(Name = "业务员")]
        [ExcelColumnName("业务员")]
        public string SaleMan { get; set; }

        [ExcelColumn(Name = "销售商品数量")]
        [ExcelColumnName("销售商品数量")]
        public int Nums { get; set; }

        [ExcelColumn(Name = "实销商品数量")]
        [ExcelColumnName("实销商品数量")]
        public int RealNums { get; set; }

        [ExcelColumn(Name = "销售订单数量")]
        [ExcelColumnName("销售订单数量")]
        public int Orders { get; set; }

        [ExcelColumn(Name = "销售金额")]
        [ExcelColumnName("销售金额")]
        public decimal Amt { get; set; }

        [ExcelColumn(Name = "分销收入")]
        [ExcelColumnName("分销收入")]
        public decimal Money { get; set; } = 0;


        [ExcelColumn(Name = "退货商品数量")]
        [ExcelColumnName("退货商品数量")]
        public int retNums { get; set; }


        [ExcelColumn(Name = "退货订单数量")]
        [ExcelColumnName("退货订单数量")]
        public int retCount { get; set; }


        [ExcelColumn(Name = "退货金额")]
        [ExcelColumnName("退货金额")]
        public decimal retAmt { get; set; } = 0;
        [ExcelColumn(Name = "退货率")]
        [ExcelColumnName("退货率")]
        public string retRate { get; set; }
    }

    /// <summary>
    /// 客户销售明细
    /// </summary>
    public class RptSaleDetail
    {
        public int rowNo { get; set; }
        /// <summary>
        /// 订单时间
        /// </summary>
        public DateTime orderTime { get; set; }
        /// <summary>
        /// 订单类型
        /// </summary>
        public string orderType { get; set; }
        /// <summary>
        /// 订单号
        /// </summary>
        public string orderId { get; set; }
        /// <summary>
        /// 货号
        /// </summary>
        public string sn { get; set; }
        /// <summary>
        /// 品名
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 客户
        /// </summary>
        public string userName { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public string spesDesc { get; set; }
        /// <summary>
        /// 数量
        /// </summary>
        public decimal nums { get; set; }
        /// <summary>
        /// 赠送数量
        /// </summary>
        public decimal sendNums { get; set; }
        /// <summary>
        /// 合计
        /// </summary>
        public decimal sumNums { get; set; }
        /// <summary>
        /// 价格
        /// </summary>
        public decimal price { get; set; }
        /// <summary>
        /// 金额
        /// </summary>
        public decimal amount { get; set; }
        /// <summary>
        /// 含税价
        /// </summary>
        public decimal saleTaxPrice { get; set; }
        /// <summary>
        /// 含税金额
        /// </summary>
        public decimal saleTaxAmount { get; set; }
        /// <summary>
        /// 销售成本
        /// </summary>
        public decimal saleCostAmount { get; set; }
        /// <summary>
        /// 销售毛利
        /// </summary>
        public decimal saleGrossAmount { get; set; }
        /// <summary>
        /// 销售利润
        /// </summary>
        public decimal saleProfitAmount { get; set; }
    }
    /// <summary>
    /// 客户销售汇总
    /// </summary>
    public class RptSaleSummary
    {
        /// <summary>
        /// 序号
        /// </summary>
        public int rowNo { get; set; }

        /// <summary>
        /// 退货率
        /// </summary>
        public decimal backPercent { get; set; }
        /// <summary>
        /// 销售比重
        /// </summary>
        public decimal salePercent { get; set; }
        /// <summary>
        /// 客户Id
        /// </summary>
        public long userId { get; set; }
        /// <summary>
        /// 客户编号
        /// </summary>
        public string userCode { get; set; }
        /// <summary>
        /// 客户名称
        /// </summary>
        public string userName { get; set; }
        /// <summary>
        /// 实际销售数量
        /// </summary>
        public decimal realSaleNums { get; set; }

        public decimal saleNums { get; set; }
        /// <summary>
        /// 实际销售金额
        /// </summary>
        public decimal realSaleAmount { get; set; }

        /// <summary>
        /// 实销含税金额
        /// </summary>
        public decimal realTaxSaleAmount { get; set; }
        /// <summary>
        /// 销售成本
        /// </summary>
        public decimal saleCostAmount { get; set; }
        /// <summary>
        /// 销售毛利
        /// </summary>
        public decimal saleGrossAmount { get; set; }
    }
}
